<template>
  <div id=content @click="showName">
      <h2>学生名字：{{studentObj.name}}</h2>
      <h2>学生年龄：{{studentObj.age}}</h2>
      <h2>学生性别：{{studentObj.sex}}</h2>
  </div>
</template>

<script>
    export default {
        name:'Students',
        data (){
            return {
                studentObj:{
                    name:'涨停三',
                    age:14,
                    sex:'男'
                }
            }
        },
        methods: {
            showName() {
                this.$emit('getName',this.studentObj.name,123,345,678)
            }
        },
    }
</script>

<style scoped>
    #content {
        background-color: pink;
        padding:5px 10px;
        margin: 10px;
    }
</style>